package com.example.assetmanagement.mapper;

import com.example.assetmanagement.domain.Asset;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AssetMapper {

    List<Asset> selectPage(@Param("offset") int offset,
                           @Param("limit") int limit,
                           @Param("name") String name,
                           @Param("categoryId") Long categoryId,
                           @Param("status") Integer status);

    long count(@Param("name") String name,
               @Param("categoryId") Long categoryId,
               @Param("status") Integer status);

    Asset selectById(@Param("id") Long id);

    int insert(Asset asset);

    int update(Asset asset);

    int deleteById(@Param("id") Long id);

    int deleteBatch(@Param("ids") List<Long> ids);
} 